home *** CD-ROM | disk | FTP | other *** search
/ Night Owl 6 / Night Owl's Shareware - PDSI-006 - Night Owl Corp (1990).iso / 019a / amac40.zip / TIM005.QM < prev    next >
Text File  |  1991-08-02  |  11KB  |  218 lines

  1. *                               TIM005.QM
  2. *                        Written By Tom Hogshead
  3. *                       [ See TIMERxx.QM For Use ]
  4. *                            August 2, 1991
  5. *  Key    Subfile
  6. * =====  =========  =====================================================
  7. * @(p)            --Times Macro Command Sequences For 1 To 100,000 Repeats|new
  8. *                   Using [Command n] Timing Counter
  9. *     {e:\up\TIMER14}--Return To TIMERxx.QM
  10. *
  11. *-- eoi
  12.  
  13. * 
  14. * -------------------------------------------------------------------------
  15. * @(p)  Times Macro Command Sequences For 1 To 100,000 Repeats
  16. *       Using [command n] Timing Counter
  17. *       420 bytes Sun  07-14-1991  10:42:57 (TH @p, [command n] counter)
  18. * -------------------------------------------------------------------------
  19.  
  20. * This version is a modification of @1 for timing single inserted commands
  21. * only. Single commands to be timed are limited to those that can be entered
  22. * in the form:
  23.  
  24. *         [ inserted command ]   [ number of repeats ]
  25.  
  26. * like:
  27.  
  28. *                     cursorright 500
  29.  
  30. * It is included here as example of another timing technique only.  Timing
  31. * measurements using @p cannot be compared to results using @1 or @r.
  32.  
  33. * See @r for Base Time of @p.
  34.  
  35. @p  macrobegin
  36.     unmarkblock defaultwordset
  37.     setrmargin "80" return              * For timer messages on same line
  38.     insertline begline dropanchor
  39.     currentfilename copy                * Save currentfilename to return to
  40.     gotocolumn "41" return
  41.     dropanchor begline
  42.     fillblock "*" return                * Insert start line
  43.     editfile "0k" return quit           *
  44.     editfile return
  45.    "Cycle [Y=yes, Enter=no] ?"          * Y for yes, Enter for one cycle only
  46.     cursorright dropanchor
  47.     Pause
  48.     *---------------------------------------------------------------- *
  49.     *  Buffer                    Description                          *
  50.     * ========    =================================================== *
  51.     *     1   -   [Y] or [y] to cycle, [Enter] for only one cycle     *
  52.     *     2   -   Size = no of repeats to time, eg 1k = 1000 repeats  *
  53.     *     3   -   # of lines of counting characters                   *
  54.     *     4   -   # of counting characters per counting line          *
  55.     *     5   -   Character after buff 4 (* for 1/5/50/100 repeats)   *
  56.     *---------------------------------------------------------------- *
  57.     storescrbuff "1" return             * Y, or Enter for one cycle only
  58.     delline                             * Delete message line
  59.     editfile "$repeat" return
  60.     Pause
  61.     delrtword                           * Delete empty space
  62.     markcharacter                       *
  63.     gotocolumn "7" return               * Mark Size
  64.     storescrbuff "2" return             * Size
  65.     wordright                           *
  66.     markword                            *
  67.     storescrbuff "3" return             * # of AddLines
  68.     wordright markword                  *
  69.     storescrbuff "4" return             * Chars per line to delete
  70.     gotoblockend                        *
  71.     unmarkblock                         *
  72.     cursorright                         * Move to empty space
  73.     markcharacter                       * Start mark
  74.     endline                             * Mark buff 5
  75.     storescrbuff "5" return             * Store buff 5, blank if nothing
  76.     quit                                * Quit $repeat
  77.     editfile "$line#" return quit       * Quit $line# if loaded
  78.     editfile paste return               * Return to file we started in
  79.     onewindow
  80.     *--------------------------------------------------------*
  81.     * Window    File              Description                *
  82.     * ======   ======   ==================================== *
  83.     *   1               File to record timing record         *
  84.     *   2      0k       Zero length file to count repeats    *
  85.     *   3      $line#   contains 001-999 for cycle counting  *
  86.     *--------------------------------------------------------*
  87.     horizontalwindow                    * 0k window
  88.     editfile "0k" return
  89.     shrinkwindow
  90.     cursordown cursordown cursordown
  91.     cursordown cursordown cursordown
  92.     escape
  93.     horizontalwindow                    * Cycle # window
  94.     editfile "$line#" return
  95.     endline cursorright cursorright
  96. *-- InsertTime in $line#
  97.     inserttime                          * Insert approx start time in $line#
  98.     getscrbuff "2" return               * Insert size selected
  99.     unmarkblock
  100.     prevwindow                          * 0k window
  101.  CYCLE:
  102.         getscrbuff "3" return               * Get # of addlines
  103.         cut
  104.         begline                             *
  105.         getscrbuff "5" return               * Get buff 5
  106.         endline                             * Test if buff 5 has text
  107.         jfalse L1:                          * If false, buff 5 has no text
  108.         delline                             *ELSE buff has text
  109.         getscrbuff "4" return               * Get # of chars/line to count
  110.         cut                                 * Cut to scrap
  111.         begfile                             *
  112.         markcolumn                          *
  113.         gotocolumn paste return             * Go to end of block
  114.         fillblock "*" return                * Fill with stars
  115.         delch                               * Delete one counting char
  116.                                             * because delch "fail"= 1 rpt
  117. *       Pause                               * Add to see # of repeats - 1
  118.                                             * eg, 4 stars = 5 repeats
  119.         jump REFILL:                        *
  120.    L1:                                      *
  121.         delline                             * Delete extra line from buff 5
  122.         addline                             *
  123.         repeatcmd paste return              * Add lines for counting block
  124.         getscrbuff "4" return               * Get # of chars/line to count
  125.         cut                                 * Cut to scrap
  126.         cursorup cursorup                   * Move up to buff #4 line #
  127.    jump L5:                                 * Bypass block filling          |b
  128.    L2:  gotocolumn paste return             * Go to end of block
  129.         cursorleft                          * Position cursor one column
  130.                                             * left of # of counting chars
  131.                                             * because delch "fail"= 1 rpt
  132.         markcolumn begfile                  * Mark block end/begin
  133. *  L3:  fillblock "*" return jump REFILL:   * Count w/ all stars, for tests
  134. *  L4:  fillblock " " return jump REFILL:   * Empty block, for tests
  135.         fillblock  #248  return                         * °°°°°°°°°
  136.         gotocolumn "101" return fillblock #007 return   * 
  137.         gotocolumn "201" return fillblock #249 return   * ∙∙∙∙∙∙∙∙∙
  138.         gotocolumn "301" return fillblock #250 return   * ·········
  139.         gotocolumn "401" return fillblock "."  return   * .........
  140.  REFILL:
  141.         unmarkblock
  142.         endpara begline
  143.    L5:
  144.         prevwindow                      * Timing record window
  145.         makectrofscreen
  146.         insertline begline
  147.        "*" gotocolumn "41" return "*"   * Insert starting line of stars
  148.         *-------------------------------------------------------------------*
  149.         * My DiskPark TSR parks my hard disk after 9 minutes of no access.  *
  150.         * I don't want TSR timing interference for > 9 minutes cycling.     *
  151.         * Add these 6 lines if you have TSR disk access during cycling.     *
  152.         *-------------------------------------------------------------------*
  153. *       getscrbuff "1" return     *                                         *
  154. *       endline                   * Test if 'y' to cycle                    *
  155. *       jfalse NOSAVE_FILE:       * If false, are at eol, don't save        *
  156. *       savefile                  *ELSE save file                           *
  157. *       NOSAVE_FILE:              *                                         *
  158. *       cut                       * Remove buffer 1 from screen             *
  159.         *-------------------------------------------------------------------*
  160.         cursorright
  161. * ■■■■■ Timing Starts Here ■■■■■
  162.         Insert_Time
  163.         nextwindow                      * 0k window
  164.         TIME:* 
  165. * **** < Commands to Time Inserted Here, Single Commands Only> ****
  166.         prevwindow                      * Timing record window
  167.         gotocolumn "53" return
  168. *       500_TIME: insertline            * Add to show time after counting line
  169.         deltoeol                        * Delete previous time
  170.         Insert_Time
  171. * ■■■■■ Timing Ends Here ■■■■■
  172.         prevposition                    * Move to first char of time
  173.         delrtword delch                 * Delete 'Hour:'
  174.         nextwindow                      * 0k window
  175.       begline                         * In case inserted commands move cur  |b
  176.         cursorup                        * Move up to next counting line
  177.         jtrue TIME:                     *  until no more lines to count
  178.         nextwindow                      * Cycle # window
  179.         begline markword
  180.         copy                            * Copy current cycle # for timer
  181.         wordright
  182.         markcolumn endline markcolumn
  183.         gotoblockbeg cursordown
  184.         moveblock                       * Move start Time/Size to next line
  185.         unmarkblock
  186.         begline scrolldown
  187.         nextwindow                      * Timing record window
  188.         endline cursorright cursorright
  189.         insertdate                      * Insertdate
  190.         wordleft delch delch            * Delete 91
  191.         wordleft wordleft wordleft
  192.         delrtword                       * Delete day of week
  193.         endline cursorright "@p"        * Insert macro key
  194.         cursorright                     *
  195.         getscrbuff "2" return           * Insert size
  196.         gotocolumn "77" return          *
  197.         paste                           * Insert current cycle #
  198.         unmarkblock
  199.         nextwindow                      * 0k window
  200.     BEGLINE                             * Reposition for cycle test         |b
  201.         getscrbuff "1" return           * Get answer to cycle prompt
  202.         endline                         * Test if answered 'y' to cycle
  203.  jtrue CYCLE:                           * If true, are at eol, cycle again
  204.         prevwindow                      * Timing record window
  205.         dropanchor                      * Mark timer to return to
  206.         prevwindow                      * Cycle number window
  207.         quit                            * Quit $line#
  208.         editfile "0k" return quit       * Quit 0k
  209.         gotoblockbeg unmarkblock        * Return to file we started in
  210.         onewindow                       * Close all windows
  211.         begline cursorright cursorright * Position cursor to calculate time
  212. *
  213. * 380 bytes Mon  06-17-1991  21:41:37 (TH @1)
  214. * 380 bytes Fri  06-28-1991  07:26:45 (TH @1)
  215. * 419 bytes Sun  07-07-1991  13:56:04 (TH @1, added 1/5/50/100 repeats)
  216. * 420 bytes Sun  07-14-1991  10:42:57 (TH @p, [command n] counter)
  217.  
  218.